<template>
  <div>
    <div class="myform">
      <div class="center">
        <div>
          <img width="100%" src="/image/macar_b.jpg" alt="" />
        </div>
        <div style="display: flex">
          <ul style="font-size: 13px">
            <li>礼盒装</li>
          </ul>
          <ul style="margin-top: 10px">
            <li
              v-for="(item, index) in data"
              :key="index"
              style="margin-bottom: 40px"
            >
              <img width="200" :src="`/mp${item.image}`" alt="" />
              <div style="font-weight: 800; margin-top: 10px">
                {{ item.title }}
              </div>
              <div>
                <div style="margin-top: 5px">{{ item.stitle }}</div>
                <div style="margin-top: 5px">{{ item.price }}</div>
              </div>
              <button style="margin-top: 5px">加入购物车</button>
            </li>
          </ul>
        </div>
        <div style="text-align: center; font-size: 13px; color: #543018">
          <span>首页</span>
          <span>上一页</span>
          <span>1</span>
          <span>下一页</span>
          <span>尾页</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [],
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    getData() {
      let url = "/mp/main_makalong";
      this.axios.get(url).then((res) => {
        console.log(res);
        this.data = res.data.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.myform {
  margin-top: 40px;
  .center {
    padding: 10px;
    border: 1px solid blanchedalmond;
    background-color: #f3f0ed;
    width: 50%;
    margin: auto;
    div:last-child > span {
      margin-right: 10px;
    }
    div:last-child > span:hover {
      color: #a56224;
    }
    .cur {
      color: #a56224;
    }
    ul:first-child {
      li {
        width: 5vw;
        margin-left: 20px;
        margin-top: 20px;
        margin-right: 40px;
        color:#543018 ;
      }
      li:hover {
        color: #a56224;
      }
    }
    ul:last-child {
      li {
        margin-left: 50px;
        color: #543018;
        button {
          background-color: #543018;
          color: white;
          border-radius: 5px;
          padding: 10px;
          font-size: 13px;
        }
      }
    }
  }
}
</style>